<template>
    <div class="contain">
        <el-carousel  class="siwpers" height="30rem">
        <el-carousel-item v-for="item in swiperList" :key="item.id" :indicator-position="swiperList.length>0">
            <div class="siwpers-img">
                <img class="siwper-items" :src="item.img" alt="">
            </div>
        </el-carousel-item>
        </el-carousel>
        <div class="center-msg">
              <img  src="../../assets/center-img.png" alt="">
        </div>
        <div class="compenys">
               <div class="compeny-item" v-for="item in compenyList" :key="item.id" @click="toDetail(item.id)">
                   <img class="item1" :src="item.coverImg" alt="">
                   <div class="item3">{{item.name}}</div>
               </div>
         </div>
         <div class="certificate">
              <div class="certificate-title">荣誉证书</div>
              <div class="certificate-1">
                  <div class="certificate-item1" v-for="item in 4" :key="item">
                    <img src="../../assets/shukuang.png" alt="">
                    <span class="certificate-name">国家级高新技术企业认证</span>
                  </div>
              </div>
              <div class="certificate-2">
                <div class="certificate-item2" v-for="item in 7" :key="item">
                    <img src="../../assets/hengkuang.png" alt="">
                </div>
              </div>
         </div>
         <div></div>
         <div class="bottom-msg">
                <div class="banquan">果园农业种植数据管理平台 版权所有</div>
                <div class="tips"><span>使用前必读</span><span>帮助中心</span><span>京公网安备xxxxxxx号</span></div>
                <div class="compeny">互联网农业信息服务资格证书 (京)-经营性-2017-0020  ｜  信息网络传播视听节目许可证 xxxx </div>
         </div>
    </div>
</template>
<script setup>
import { onMounted } from 'vue';
import {findCompList,getBannerList} from '../../util/api.js'
        const swiperList =ref([])
        const compenyList = ref([])
        const router = useRouter()
        const getBannerLists = async()=>{
            let res= await getBannerList({type:'名企名品'})
            console.log(res)
            if(res.code!=200)return
            swiperList.value=res.data
        }
        const findCompLists = async()=>{
            let res= await findCompList()
            console.log(res)
            if(res.code!=200)return
            compenyList.value=res.data
        }
        const toDetail = (id)=>{
            router.push({
                path:"/enterprisesDetail",
                query:{
                    id,
                }
            })
        }
        onMounted(()=>{
            getBannerLists()
            findCompLists()
        })
</script>
<style lang="scss" scoped>
.contain{
    width:100%;
    .siwpers{
        width: 100%;
        height: 480px;
        :deep(.el-carousel__arrow--left){
                width: 60px;
                height: 60px;
                left: 80px;
                border: 1px solid #52B870;
                font-weight: 500;
                font-size: 16px;
                color: #52B870;
                background: none;
                }

                //右箭头
        :deep(.el-carousel__arrow--right){
        width: 60px;
        height: 60px;
        right: 80px;
        border: 1px solid #52B870;
        font-weight: 500;
        font-size: 16px;
        color: #52B870;
        background: none;
        }
        .siwpers-img{
            width: 100%;
            height: 480px;
            // background-image: url('../../assets/compeny.png');
            background-size: 100% 100%;
            position: relative;
            .siwper-items{
                width: 100%;
                height: 100%;
                position: absolute;
                left: 0;
                top: 0;
            }
            .adress{
                width: 130px;
                background: #FFFFFF;
                box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.5);
                border-radius: 20px;
                display: flex;
                justify-content: space-around;
                align-items: center;
                font-size: 14px;
                font-weight: 500;
                color: #323232;
                box-sizing: border-box;
                padding: 5px 10px;
                position: absolute;
                right: 40px;
                bottom: 20px;
                cursor: pointer;  
            }
            .adress img{
                width: 14px;
                height: 18px;
            }
            .toFruit{
                width: 126px;
                height: 36px;
                background: #FFFFFF;
                box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.5);
                border-radius: 2px;
                font-size: 14px;
                font-family: PingFangSC-Medium, PingFang SC;
                font-weight: 500;
                color: #323232;
                line-height: 14px;
                text-align: center;
                position: absolute;
                left: 60px;
                bottom: 30%;
                cursor: pointer;
                .right{
                   color: #52B870;
                   font-size: 14px;   
                   line-height: 36px;
                   margin-left: 15px;
                }
            }
            .names{
                display: inline-block;
                font-size: 50px;
                // font-family: AlimamaShuHeiTi-Bold, AlimamaShuHeiTi;
                font-weight: bold;
                color: #52B870;
                line-height: 50px;
                text-shadow: 0px 2px 4px rgba(255,255,255,0.5);
                position: absolute;
                bottom: 60%;
                left: 60px;
            }
            
        }
    }  
    .center-msg{
       width: 100%;
       box-sizing: border-box;
       background-color: #f7f7f79d;
       padding-top:100px ;
       img{
        width: 1468px;
        height: 830px;
        margin: 0 auto;
       }
    }
    .compenys{
        width: 100%;
        box-sizing: border-box;
        padding: 100px 200px;
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        .compeny-item{
            width: 448px;
            display: flex;
            align-items: center;
            flex-direction: column;
            margin-bottom: 48px;
            cursor: pointer;
            .item1{
               width: 100%;
               height: 258px;
            }
            .item2{
               width: 200px;
               height: 40px;
            }
            .item3{
                font-size: 18px;  
                color: #666666;
                font-weight: 400;
                margin: 40px 0;
            }
        }
    }
    .certificate{
        width: 100%;
        background-color: #F7F7F7;
        padding: 100px 220px;
        box-sizing: border-box;
        .certificate-title{
            width: 100%;
            text-align: center;
            font-size: 38px;
            font-family: PingFangSC-Medium, PingFang SC;
            font-weight: 500;
            color: #121212;
            margin-bottom: 100px;
        }
        .certificate-1{
            display: flex;
            justify-content: center;
            flex-wrap: nowrap;
            color: #666666;
            font-size: 18px;
            font-weight: 400;
            gap:40px;
            .certificate-item1{
                width: 243px;
                text-align: center;
                img{
                    width: 100%;
                    height: 183px;
                }
                span{
                    display: block;
                    margin: 30px 0;
                }
            }
        }
        .certificate-2{
            display: flex;
            justify-content: center;
            flex-wrap: nowrap;
            color: #666666;
            font-size: 18px;
            font-weight: 400;
            gap:40px;
            .certificate-item2{
                width: 159px;
                text-align: center;
                img{
                    width: 100%;
                    height: 197px;
                }
            }
        }
        .certificate-2{
            display: flex;
        }
    }
    .bottom-msg{
        width: 100%;
        padding: 0 10%;
        padding-top: 30px;
        box-sizing: border-box;
        .banquan{
            width: 416px;
            padding: 10px 0;
            background: #52B870;
            border-radius: 30px;
            font-weight: 600;
            font-size: 22px;
            text-align: center;
            color: #FFFFFF;
        }
        .tips{
            font-size: 18px;
            font-family: PingFangSC-Semibold, PingFang SC;
            font-weight: 600;
            color: #323232;
            margin: 30px 0;
            span{
                margin-right: 60px;
            }
        }
        .compeny{
            font-size: 18px;
            font-weight: 400;
            color: #666666;
            padding-bottom: 60px;
        }
    } 
}
</style>